home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d3
/
amac33.arc
/
SRCH21.QM
< prev
next >
Wrap
Text File
|
1991-04-28
|
46KB
|
960 lines
* (SRCH21).QM. v2.1a
*┌─────────────────[ (INDEX) Search/Replace Macros ]───────────────────────────┐
*│(CursorLeft) Wrap cursor to previous line like Wordstar does
*│(CursorRight) Wrap cursor to next " " " "
*│ [These two macros were written by Tim Farley]
*│
*│@(a) Moves cursor to first word delimiter after wordleft
*│@(f) Moves cursor to first word delimiter after wordright
*│^(a_) Moves cursor to first character of wordleft
*│^(f_) Moves cursor to first character of wordright
*│
*│@(0) - Srch/rplc from command line, loads files w/SR.BAT, no prompt
*│@(7) - Srch ONLY from command line, loads files w/SRL.BAT, no replace
*│@(1)─┐ Makes FileList of files containing search text while editing
*│@(2)─┤ Loads FileList of files containing search text while editing
*│@(8)─┘ Srch/rplc while editing loaded files only, prompts,
*│ saves ONLY & keeps loaded ONLY files w/replacements.
*│@(5) - Srch/rplc while editing, finds/loads files, prompts
*│@(9) - Srch ONLY loaded files, keep loaded ONLY files w/ found text
*│
*│@(h) - Select Index item with cursor line, then <enter>.
*│(F4) - RepeatFind
*│(F6) - NextFile
*│
*│(Index) Use - How to locate macro or item below from Index using @h
*│(Description) - Search/Replace Macros
*│(Startup) - What's required
*│(Macros) - Search/Replace Macros
*│(Other) Macros - not included
*│(Version) history
*└────────[ be sure to leave at least one blank line at end of Index ]────────┘
* QQQ www for search/replace test
* Confirms Saves Must Be
* Replace- Loaded First Byte
* Key Run While ment? Files? Macro? Comments Size
* ── ───────── ──────── ────── ────── ─────────────────── ────
* @0 cmnd line no yes yes s/r w/SR.bat 153
* @7 cmnd line n/a n/a yes load only w/SRL.bat 37
* @1─┐editing n/a n/a no makes FileList only 99
* @2─┤editing n/a n/a no loads files only 19
* @8─┘editing yes rpl only no s/r loaded files 41
* @5 editing yes rpl only no s/r finds files 235
* @9 editing srch only no no s/o loaded files 40
* @h editing - - - Help locate macros 47
* (Index) Use;
*
* To locate a macro or item in this file, press @h, place the cursor
* line on the desired item in the Index above, and press <enter>.
* See BOOK15.QM for more details.
* (Description):
*
* (SRCH1A) are QEdit macros to search/replace only files containing
* search text from a FileList of file search patterns. Only files
* containing the search text are loaded automatically, and then the
* desired search/replace is performed. Search/replace may also be run
* from the command line and while editing files.
* To BEGIN, just type "START SRCH" <Enter>. All pertinent files will be
* loaded in the "Ring" for viewing, and SRCH21.MAC is read.
* Alternatively, type "START SRCH 0" <Enter> and the disk copies of all
* files in the "Ring" will be loaded ready for editing, saving time.
* (Startup):
*
* In order for the search/replace macros to run, first make a
* FileList, SRCH-FG.LST, of the file patterns to be searched.
* Here's mine:
* *.qm
* *.ql
* *.inf
* *.bat
* *.lst
* *.me
* *.doc
* *.syn
* e:\syn\sa.syn
* u:\sr?.bat
* The SA.SYN entry is my PCED synonym file.
* You may want to consider putting only one single file name in the list
* to try these macros, eg TEST.QM.
* To perform a search/replace from the command line, type SR, and
* answer the prompts for search and replace text. To perform a SEARCH
* ONLY from the command line, type SRL, and answer the prompts for
* search text. All searches with these macros and batch files are
* non-case sensitive. To perform a case sensitive search, change "IGN"
* to "GN"in the macros below and "-f" to "-fc" in the batch files.
* Chris Dunford's excellent FGREP and William Parke's INPUT.COM must be
* located in the path. FGREP can be found on CompuServe IBMAPP Lib 1 as
* FGREP.ARC, v1.71, and on Exec-PC as FGREP172.ZIP. INPUT can be found
* on Exec-PC as INPUT.ZIP. They are probably on many other BBS's also.
* When using SR.BAT or SRL.BAT, the message "0 Files copied" means no
* files were found containing the search text, and the macro stops with
* the file c:! loaded but it contains no output from FGREP.
* Search and replacement text may be single or multiple words.
*
* Replacing C: with your ram disk will make the macros run faster.
* Alt_0/7 set and use the Dos environment variables FGS and FGR. The
* letters "FGS" and "FGR" must NOT occur in any other Dos environment
* variable name or value. You must have enough environment space to
* store both the search and replacement text.
* QEdit must be named Q.EXE.
* Insert should be ON.
* For (other) macros, see ALLMACRO.INF.
* These macros require "QEdit and QMAC v2.1, February, 1990" or later.
* (Macros):--------------------------------------------------------
*
*┌─────────────────────────────────────────────────────────────────────┐
*│ @(0) Macro for search/replace from command line with SR.BAT │
*└─────────────────────────────────────────────────────────────────────┘
* ******** MUST BE FIRST MACRO IN FILE FOR START UP IN SR.BAT*********
* ****** MUST RUN SR.BAT TO USE THIS MACRO******
*
* To do a search/replace from command line, just type SR, and answer
* prompts for search and replacement text.
*
* TEST.QM is included to show how this macro works. Type/enter at the
* command line as follows:
*
* 1. "SR" <enter>
* 2. "aaa" space "bbb" <enter> (answer SEARCH text prompt)
* 3. "aaa" space "BBB" <enter> (answer REPLACEMENT text prompt)
* This version of @0 also uses the "Once-Around the ring" technique of
* Kyle Watkins. This macro is smaller and faster than Version 1.8 and
* prior because files are loaded by NextFile rather than EditFile, and
* SET >c:$ is moved to the SR.BAT batch file from the macro.
* When finished running with the batch file or PCED, the following
* files are loaded for viewing or editing:
*
* Window 1 -list of files found & search text (output from FGREP)
* Window 2...n+1 -files containing search text, n = (# files found)
*
*
* Temporary file names are:
*
* c:$.ql List of files found & search text (output from FGREP)
* c:! Same as c:$.ql
* c:$ Output of Dos SET.
* _ NUL file (NUL file is also ! in some other macros)
* When using SR.BAT or SRL.BAT, the message "0 Files copied" means no
* files were found containing the search text, and the macro stops with
* the file c:! loaded but it contains no output from FGREP.
*
@0 MacroBegin
***************************************** LOAD FILES
altwordset * For all file names
endfile * Get to end of file
LOADAGAIN: *
unmarkblock * Unmark last file name
find #42 "Fi" return "B" return* Find file name
jfalse END: * No find ? quit
wordright * Move to space
wordright * Move to file name
markcolumn * Mark it
endline * Get all name in block
copy * Copy file name to scrap
EditFile * Get ready to load
CurrentFilename " " * To force return *here*
Paste Return * Paste file name & do it!
cursorup * Go to next line
jfalse ENDLOAD: * No more filenames? Done load
jump LOADAGAIN: * Check again
ENDLOAD: *
quit * Quit c:! from ring so no rplc
***************************************** GET SEARCH TEXT TO SCRATCH
editfile "c:$" return * Load set output file
find "FGS" return return * Find FGS
wordright * Get to SEARCH text
markcolumn * Begin mark
endline * Mark SEARCH text
cursorleft * No trailing space in block
storescrbuff "FGS" return * Store SEARCH text to scratch
***************************************** GET REPLACE TEXT TO SCRATCH
unmarkblock * Get ready
begfile * Get to top
find "FGR" return return * Find FGR
wordright * Get to REPLACE text
markcolumn * Begin mark
endline * Mark it all
cursorleft * No trailing space in block
storescrbuff "FGR" return * Store REPLACE text to scratch
killfile * Kill c:$ for next time
quit * Remove c:$ from ring
***************************************** BEGIN SEARCH/REPLACE
Editfile "_" Return * Insert -or- GoTo NUL File
getscrbuff "FGS" return cut * Cut search text from scratch
Find paste Return escape * Initialize find prompt
getscrbuff "FGR" return cut * Cut replace text from scratch
FindReplace return * Begin replacement
paste return * paste REPLACEMENT text
** "IGN" Return ** Replace, no prompt
Pause Return * Allow user input of Options
Begline Cursorright * Put cursor in Col. 2 of NUL File
LOOP: * Main test loop
Nextfile * Move to next files in Ring
Cursorleft * Move cursor left (need for NUL test)
Jfalse DOIT: * If couldn't move to left, it's not
* the NUL File AND cursor position
* has not changed -- GO with the
* FindReplace
*ELSE
* Check to see if in the NUL File
Cursorleft * Move cursor left for NUL Test
Jfalse ENDLOOP: * If couldn't move left -- We
* ARE in the NUL File and Need
* to ENDLOOP
*ELSE
Cursorright * Move back to Col. 2 in NUL File
DOIT: * FindReplace Loop
BegFile * Move up in case cursor is below find
Repeatfind * Do the FindReplace
Jtrue SAVE: * If CHANGES are made -- SAVE the File
Quit * If NO CHANGES are made -- QUIT the
* File
Jump LOOP: * Return to the Main Loop
SAVE: * Routine to Save a File with Changes
Savefile * Save the file
Jump LOOP: * Return to Main Loop
ENDLOOP: * Loop is DONE
Quit * Quit the NUL File
END: *
defaultwordset * set default
*
* 191 bytes Sun 09-16-1990 15:09:40
* 153 bytes Tue 10-02-1990 18:50:33
*┌─────────────────────────────────────────────────────────┐
*│ @(1) - makes FileList of files containing search text │
*└─────────────────────────────────────────────────────────┘
@1 MacroBegin
Dos 'FGREP -f0 "' * Make FileList
Pause *
'">c:! @SRCH-FG.lst' *
return return *
editfile "c:!" return quit * Edit FileList
editfile return *
begfile *
MarkColumn * Mark begfile c:!
endfile begline * Mark endfile col 1
wordright wordright * Get to file name
cursorleft * Move off file name
DeleteBlock * Delete file name
SaveFile * Save FileList
begfile * Get to begin
MarkColumn * Mark begfile c:!
EndFile * Get to end
gotocolumn "12" return * Get all file names in block
Sort * Sort FileList
killfile * Kill c:!
begfile * See FileList
unmarkblock * Without block mark
*
* 99 bytes Thu 09-13-1990 16:30:45
*┌──────────────────────────────────────────────────────────────┐
*│ @(2) - loads FileList of files containing search text │
*└──────────────────────────────────────────────────────────────┘
* Written by Kyle Watkins, SemWare.
*
@2 MacroBegin
***************************************** LOAD FileList (from QLSTxx)
EndFile BegLine * Start at last line
REPEAT:
UnmarkBlock MarkLine Copy * Grab this name
EditFile * Get ready to load
CurrentFilename " " * To force return *here*
Paste Return * Paste file name & do it!
CursorUp * More lines above?
JTrue REPEAT: * If yes, repeat.
*
* 19 bytes Mon 09-03-1990 00:56:04
*┌───────────────────────────────────────────────────────────────────┐
*│ @(5) Makes and loads FileList of files containing search text, │
*│ then search/replace loaded files while editing │
*└───────────────────────────────────────────────────────────────────┘
*
@5 MacroBegin
***************************************** GET SEARCH TEXT
unmarkblock *
Editfile '!' Return * Insert -or- GoTo NUL File
"Search Text=" markcolumn pause * Search text?
storescrbuff "1" return copy * Copy search text to scrap
***************************************** GET REPLACE TEXT
RETURN * Move to next line
"Replace Text=" markcolumn pause * Replacement text?
storescrbuff "2" return * Store replacement to scratch
quit * Quit NUL
***************************************** MAKE FileList
DOS 'FGREP -f0 "' * Make FileList
paste * Paste search text
'">c:! @SRCH-FG.lst' *
return return *
editfile "c:!" return quit * Edit FileList
editfile return *
begfile MarkColumn * Mark begfile c:!
endfile begline * Mark endfile col 1
jfalse END: * End if no search text found
wordright wordright * Get to file name
cursorleft * Move off file name
DeleteBlock * Delete file name
begfile * Get to begin
MarkColumn * Mark begfile c:!
EndFile * Get to end
gotocolumn "12" return * Get all file names in block
Sort * Sort FileList
***************************************** LOAD FileList (from QLSTxx)
EndFile BegLine * Start at last line
REPEAT:
UnmarkBlock MarkLine Copy * Grab this name
EditFile * Get ready to load
CurrentFilename " " * To force return *here*
Paste Return * Paste file name & do it!
CursorUp * More lines above?
JTrue REPEAT: * Yes ? repeat
killfile * Kill c:!
quit * Quit c:!
Editfile '!' Return * Insert -or- GoTo NUL File
getscrbuff "1" return cut * Cut search text from scratch
Find paste Return escape * Initialize find prompt
getscrbuff "2" return cut * Cut replace text from scratch
FindReplace return * Begin replacement
paste RETURN * paste REPLACEMENT text
** "IGN" Return ** Replace, no prompt
Pause Return * Allow user input of Options
Begline Cursorright * Put cursor in Col. 2 of NUL File
LOOP: * Main test loop
Nextfile * Move to next files in Ring
Cursorleft * Move cursor left (need for NUL test)
Jfalse DOIT: * If couldn't move to left, it's not
* the NUL File AND cursor position
* has not changed -- GO with the
* FindReplace
*ELSE
* Check to see if in the NUL File
Cursorleft * Move cursor left for NUL Test
Jfalse END: * If couldn't move left -- We
* ARE in the NUL File and Need
* to END the Macro
*ELSE
Cursorright * Move back to Col. 2 in NUL File
DOIT: * FindReplace Loop
BegFile * In case cursor is below find
Repeatfind * Do the FindReplace
Jtrue SAVE: * If CHANGES are made, SAVE the File
Quit * If NO CHANGES are made, QUIT the File
Jump LOOP: * Return to the Main Loop
SAVE: * Routine to Save a File with Changes
Savefile * Save the file
Jump LOOP: * Return to Main Loop
END: * Macro is DONE
Quit * Quit the NUL File
*
* 260 bytes Sun 09-16-1990 14:48:58
* 235 bytes Tue 10-02-1990 23:05:35
* ┌──────────────────────────────────────────────────────────────────┐
* │ @(7) -Start up macro, loads only found files, no replacement │
* └──────────────────────────────────────────────────────────────────┘
* *** IF USED, MUST BE FIRST MACRO FOR START UP WITH SRL.BAT or PCED***
* ****** MUST RUN SRL.BAT OR PCED TO USE THIS MACRO******
* This version of this macro is about half the size of @7 in v1.0i and
* runs about twice as fast.
* To run, type SRL at the command line and answer prompt for search
* text.
*
* SRL.BAT will accept SRL [search text] as long as [search text] is a
* SINGLE word. This bypasses the need to respond to the INPUT prompt
* for Search Text=. (added in v1.4)
*
* An alternative to using the batch file SRL.BAT is to use the
* following PCED synonym instead:
*
* SYN SRLFG 'echo off^break on^FGREP -f "&A" @SRCH-FG.LST >c:!
* ^Q. c:! /Esrl.mac /LSRCH21.mac^break off^echo on'
*
* Just add this synonym to the bottom of your synonym file on one line,
* or type CED SYN SRLFG 'echo ...............'.
*
* To run using PCED, type SRLFG [search text] at the command line.
*
* When finished running with the batch file or PCED, the following
* files are loaded for viewing or editing:
*
* Window 1 -list of files found & search text (output from FGREP)
* Window 2...n+1 -files containing search text, n = (# files found)
*
*
* Temporary file names are:
*
* c:$.ql List of files found & search text (output from FGREP)
* c:! Same as c:$.ql
*
* When using SR.BAT or SRL.BAT, the message "(0) Files copied" means no
* files were found containing the search text, and the macro stops with
* the file c:! loaded but it contains no output from FGREP.
*
@7 macrobegin
***************************************** LOAD FOUND FILES
altwordset * For all file names
endfile * Get to end of file
CHECKAGAIN: *
unmarkblock * Clear last file name
find #42 "Fi" return "B" return* Find file name
wordright * Move to space
wordright * Move to file name
markcolumn * Mark it
endline * Get all name in block
copy * Copy file name to scrap
EditFile * Get ready to load
CurrentFilename " " * To force return *here*
Paste Return * Paste file name & do it!
cursorup * Go to next line
jfalse END: * No more file names? End
jump CHECKAGAIN: * Check again
END: *
defaultwordset * Set default
*
* 37 bytes Thu 09-06-1990 13:53:04
* ------------------------------------------------------------------------
* @(8) MACRO TO EXECUTE THE FindReplace ACROSS THE ENTIRE RING OF FILES
* ----------------------------------------------------------------
*
* See Kyle Watkin's alternate version below for more discussion.
@8 Macrobegin
Editfile '!' Return * Insert -or- GoTo NUL File
Findreplace Pause Return * Allow user input of Find Item
Pause Return * Allow user input of Replace Item
Pause Return * Allow user input of Options
Begline Cursorright * Put cursor in Col. 2 of NUL File
LOOP: * Main test loop
Nextfile * Move to next files in Ring
Cursorleft * Move cursor left (need for NUL test)
Jfalse DOIT: * If couldn't move to left, it's not
* the NUL File AND cursor position
* has not changed -- GO with the
* FindReplace
*ELSE
* Check to see if in the NUL File
Cursorleft * Move cursor left for NUL Test
Jfalse END: * If couldn't move left -- We
* ARE in the NUL File and Need
* to END the Macro
*ELSE
Cursorright * Move back to Col. 2 in NUL File
DOIT: * FindReplace Loop
Begfile * Needed in case cursor is below Find
Repeatfind * Do the FindReplace
Jtrue SAVE: * If CHANGES are made -- SAVE the File
Quit * If NO CHANGES made -- QUIT the File
Jump LOOP: * Return to the Main Loop
SAVE: * Routine to Save a File with Changes
Savefile * Save the file with CHANGES
Jump LOOP: * Return to Main Loop
END: * Macro is DONE
Quit * Quit the NUL File
*
* 62 bytes Sat 09-15-1990 11:17:57 (K. Watkins version)
* 41 bytes Sun 09-30-1990 20:32:55 (this version)
* * ┌────────────────────────────────────────────────────────────────────┐
* * │@(8) MACRO TO EXECUTE THE FindReplace ACROSS ENTIRE RING OF FILES │
* * └────────────────────────────────────────────────────────────────────┘
* *
* * The following macro was written by Kyle Watkins of SemWare in
* * response to my request for a macro to search/replace all loaded
* * files, but also:
* * - save to disk only those files that had a replacement, and
* * - keep loaded only those files that had a replacement made.
* * It is an excellent and creative macro which I urge you to study
* * because of the unique and powerful use of a NUL file as a
* * place-marker.
*
* * ==============================================================================
* * Date: 09-14-90 (11:49) Number: 9940 SemWare Support BBS
* * To: TOM HOGSHEAD Refer#: NONE
* * From: KYLE WATKINS Read: NO
* * Subj: ONCE AROUND THE FILE-RING Conf: (0) Main Board
* * ------------------------------------------------------------------------
* * TH>I have been trying for several months to either modify the following
* * TH>macro or come up with another way to search & replace all loaded
* * TH>files but also to:
* * TH>
* * TH> - save to disk only those files that had a replacement, and
* * TH> - keep loaded only those files that had a replacement made.
* *
* * Hi Tom,
* * You may need to adjust this macro at the point where I quit the file
* * if no replacements were made to it (The macro can be adjusted to save
* * those files, if there were some pre-existing changes that were present
* * before the macro was envolked). I wasn't sure what you wanted (my own
* * preference is to retain other changes that I made before I envolked this
* * macro -- BUT I wrote the macro to just Quit those files, since that is
* * what I am guessing you want).
* * Basically, the macro will use the NUL file as a placeholder in the
* * Ring-of-Files. With cursor manipulation, I will determine when you
* * arrive at the NUL file again. Once you get back to the NUL file, the
* * macro will end. Your starting point for the FindReplace throughout the
* * entire Ring will be at the file immediately after the NUL file -- So if
* * you do not have a NUL file already loaded, the starting point will be at
* * the next file from the one that you are currently in. Otherwise, the
* * starting point will be at the next file from the present location of the
* * NUL file.
* * Note that I always return to the original cursor position, before
* * the FindReplace is executed (allowing you to select any Option for the
* * FindReplace routine).
* *
*
* * ------------------------------------------------------------------------
* * MACRO TO EXECUTE THE FindReplace ACROSS THE ENTIRE RING OF FILES
* * ----------------------------------------------------------------
* *
* @8 Macrobegin
* Editfile 'NUL' Return * Insert -or- GoTo NUL File
* Findreplace Pause Return * Allow user input of Find Item
* Pause Return * Allow user input of Replace Item
* Pause Return * Allow user input of Options
* Begline Cursorright * Put cursor in Col. 2 of NUL File
* *
* LOOP: * Main test loop
* *
* Nextfile * Move to next files in Ring
* Cursorleft * Move cursor left (need for NUL test)
* Jfalse DOIT: * If couldn't move to left, it's not
* * the NUL File AND cursor position
* * has not changed -- GO with the
* * FindReplace
* *
* *ELSE
* * Check to see if in the NUL File
* *
* Editfile
* 'NUL ' Currentfilename Return * GoTo NUL File -- AND--
* * Preload File to Edit
* * Buffer so can Return
* * to Current File
* *
* Cursorleft * Move cursor left for NUL Test
* Jfalse END: * If couldn't move left -- We
* * ARE in the NUL File and Need
* * to END the Macro
* *
* *ELSE
* Cursorright * Move back to Col. 2 in NUL File
* *
* Editfile
* Begline Delch Delch Delch Return * Bring up EditFile Prompt
* * and delete NUL and
* * Return to File we left
* *
* Cursorright * Restore Cursor to its previous
* * position and GO with the FindReplace
* *
* DOIT: * FindReplace Loop
* *
* Repeatfind * Do the FindReplace
* Jtrue SAVE: * If CHANGES are made -- SAVE the File
* *
* Quit * If NO CHANGES are made -- QUIT the
* * File
* *
* Jump LOOP: * Return to the Main Loop
* *
* *
* SAVE: * Routine to Save a File with Changes
* *
* Savefile * Save the file
* Jump LOOP: * Return to Main Loop
* *
* END: * Macro is DONE
* *
* Quit * Quit the NUL File
* *
* * 62 bytes Sat 09-15-1990 11:17:57 (added TH)
*
*
* * ----------------------------------------------------------------
* * I hope this is what you need Tom. Feel free to optimize and alter
* * the macro. The main Body of this macro can be used to allow any kind of
* * ONE-TIME File Ring Sweep. I have already used the main body of the macro
* * (with the neccessary adjustments) to Load all files that DO NOT cause a
* * PRESS ESCAPE message -- So I hope it proves useful to you.
* *
* * --... ...--
* * .......Kyle Watkins (SemWare Technical Support)
* ┌────────────────────────────────────────────────────────┐
* │@(9) Keep loaded only files with "found" text. │
* └────────────────────────────────────────────────────────┘
*
* This macro uses the same technique developed by Kyle Watkins in @8,
* to keep loaded ONLY files with "found" text. No replacement or save
* is made (@8 makes replacement and saves files with replacements, but
* files without any replacement are QUIT from ring).
*
* Version 1.6 of this macro used RepeatFind in the DOIT loop. If that
* version was executed more than once and the cursor was on the last
* occurence of the search text in a file, RepeatFind would NOT find the
* search text again, and the file was QUIT from the ring. Apparently
* RepeatFind does NOT remember the "G" option with Find.
*
* This version replaces RepeatFind with Find "G". Now, if @9 is executed
* more than once, any file with any occurence of the search text is
* correctly kept loaded.
*
@9 Macrobegin
Editfile '!' Return * Insert -or- GoTo NUL File
Find Pause Return "G" * Allow user input of Find Item
Pause Return * Allow user input of Options
Begline Cursorright * Put cursor in Col. 2 of NUL File
LOOP: * Main test loop
Nextfile * Move to next files in Ring
Cursorleft * Move cursor left (need for NUL test)
Jfalse DOIT: * If couldn't move to left, it's not
* the NUL File AND cursor position
* has not changed -- GO with the
* FindReplace
*ELSE
* Check to see if in the NUL File
Cursorleft * Move cursor left for NUL Test
Jfalse END: * If couldn't move left -- We
* ARE in the NUL File and Need
* to END the Macro
*ELSE
Cursorright * Move back to Col. 2 in NUL File
DOIT: * Find Loop
Find Return "G" return * Do the Find
Jtrue LOOP: * If FOUND -- Return to Main Loop
Quit * If NO FIND -- QUIT the file
Jump LOOP: * Return to the Main Loop
END: * Macro is DONE
Quit * Quit the NUL File
*
* 62 bytes Sun 09-16-1990 23:44:00
* 40 bytes Sun 09-30-1990 22:48:24
*┌───────────────────────────────────────────────────────────────────┐
*│@(h) Finds first word on cursor line marked in document below │
*└───────────────────────────────────────────────────────────────────┘
*
* @h macro has 2 steps:
*
* 1. Press @ and h at the same time. An ! shows at the
* end of the top line. Cursor down to desired line in Index.
*
* 2. Press Enter. The macro first erases the !, and
* then finds the first word on the cursor line in the document
* below marked with (...).
*
* See BOOK15.QM for more details.
*
@h macrobegin
unmarkblock * Unmark any marked blocks
begfile endline * Go to file begin endline
"!" * Put ! at endline
begline
find "!" return return begline * Highlight !
pause * Pause for Index selection
wordright markword * Mark first word on line
copy * Copy word to scrap buffer
begfile * Begfile
find "!" return return delch * Find & delete !
endpara * Go to end of Index
makectrofscreen * Cursor line center of window
find "(" paste ")"
return "I" return * Find first marked word in doc
jfalse NOMARK:
begline * If mark found go to begline
jump END:
NOMARK:
begfile * If no mark found go to begfile
END:
*
* 47 bytes Fri 09-14-1990 14:06:26
* =========================================================================
* Date: 10-29-90 (13:26) Number: 3156 SemWare Support BBS
* To: EDGAR ESTRADA Refer#: 3155
* From: TIM FARLEY Read: YES
* Subj: Qedit Conf: (21) ILink
* ------------------------------------------------------------------------
* EE>I'm interested in finding out how to get Qedit to wordwrap while using
* EE>the right cursor key.
*
* You mean like WordStar does, where it won't let the cursor move
* out into the "empty space" to the right of the lines?
*
* Here are some macros to do this in 2.1:
*
* *
* * Left and Right cursor definitions that wrap to previous/next
* * line like WordStar does
* *
* (CursorLeft) Macro (line added TH)
*
cursorleft MacroBegin
CursorLeft * try to go left
JTrue end: * succeed! then we are done
CursorUp * else try to go to prev line
JFalse end: * if fail, then at top of file. done.
EndLine * jump to end of previous line.
end:
*
* 13 bytes Mon 10-29-1990 19:33:07 (line added TH)
* (CursorRight) Macro (line added TH)
*
cursorright MacroBegin
EndLine * are we at end of line?
JFalse down:
PrevPosition * back to where we were
CursorRight * and right one
Jump end:
down:
CursorDown * try to go to next line
JFalse end:
BegLine
end:
*
* 18 bytes Mon 10-29-1990 19:32:57 (line added TH)
* NOTE: You must have the latest registered release of QEdit 2.1
* to use these macros. Otherwise you will experience odd
* side-effects in the menus and other special contexts where
* the arrow keys have meaning.
*
* There will be an easier way to achieve this behavior in the next
* release of QEdit.
*
* --Tim Farley
* SemWare Technical Support
*------------ (Single line macros for QCONFIG.DAT) ----------------
* cursorleft MacroBegin CursorLeft JTrue Label0: CursorUp JFalse Label1: EndLine Label0: Label1:
* cursorright MacroBegin EndLine JFalse Label0: PrevPosition CursorRight Jump Label1: Label0: CursorDown JFalse Label2: BegLine Label1: Label2:
* Here are four macros that are variations of wordleft and wordright.
* Macros @a and @f position the cursor on the first word delimiter
* after wordleft and wordright. The cursor position will be the space
* following the word as long as no other word delimiter like "," and
* "." etc immediately follows the word. Macros @a and @f do unmark any
* previously marked block, but I don't know any other way to keep this
* from happening. Macros ^a and ^f do almost what wordleft and
* wordright do except the cursor does not stop at the end of a line.
*
* @a Moves cursor to first word delimiter after wordleft
* @f Moves cursor to first word delimiter after wordright
* ^a Moves cursor to first character of wordleft
* ^f Moves cursor to first charactetr of wordright
*┌──────────────────────────────────────────────────────────────┐
*│@(a) Moves cursor to first word delimiter after wordleft │
*└──────────────────────────────────────────────────────────────┘
@a macrobegin *
wordleft wordleft * Move wordleft twice
endline * Test if on eol
jtrue NO_EOL: * If not on eol, tests true
wordleft * If on eol, goto wordleft
jump GOTOPOS: * Go to end of word
NO_EOL: prevposition * If not at eol, return
GOTOPOS: * to where we were
markword gotoblockend unmarkblock * Get to end of word
*
* 18 bytes Mon 10-22-1990 11:32:21
*┌─────────────────────────────────────────────────────────────┐
*│@(f) Moves cursor to first word delimiter after wordright │
*└─────────────────────────────────────────────────────────────┘
@f macrobegin *
wordright * Move wordright
endline * Test if on eol
jtrue NO_EOL: * If not on eol, tests true
wordright * If on eol, goto wordright
jump GOTOPOS: * Go to end of word
NO_EOL: prevposition * If not at eol, return to
GOTOPOS: * where we were
markword gotoblockend unmarkblock * Get to end of word
*
* 17 bytes Mon 10-22-1990 11:32:32
*┌─────────────────────────────────────────────────────────────┐
*│^(a_) Moves cursor to first character of wordleft │
*└─────────────────────────────────────────────────────────────┘
^a macrobegin *
wordleft * Move wordleft
endline * Test if on eol
jtrue NO_EOL: * If not on eol, tests true
wordleft * If on eol, goto wordleft
jump GOTOPOS: * End macro
NO_EOL: prevposition * If not at eol, return to
GOTOPOS: * where we were
*
* 14 bytes Mon 10-22-1990 11:53:14
*┌─────────────────────────────────────────────────────────┐
*│^(f_) Moves cursor to first character of wordright │
*└─────────────────────────────────────────────────────────┘
^f macrobegin *
wordright * Move wordright
endline * Test if on eol
jtrue NO_EOL: * If not on eol, tests true
wordright * If on eol, goto wordright
jump GOTOPOS: * End macro
NO_EOL: prevposition * If not at eol, return to
GOTOPOS: * where we were
*
* 14 bytes Mon 10-22-1990 11:53:03
* (F4)
f4 RepeatFind
* (F6)
f6 NextFile
* (VERSION) HISTORY:
*
* 1.0a - Corrected @5 to use @SRCH-FG.lst, not SRCH.lst.
* 1.0b - Modified to not use optional batch file.
* - Removed @5.
* 1.0c - Added Alt_0 for search/replace from command line.
* - Modified SRC.BAT, @1 & @4 for case sensitive search.
* - Modified @4 to re-load search files after replacement.
* - Corrected @1 byte size.
* 1.0d - Removed redundant lines from @0, shortened 31 bytes
* - added START-SR.BAT for quick start.
* - Changed c:srch.ql to c:$.qm in macros and batch files.
* so as to not overwrite qsrch.ql supplied in SRCHxx.ZIP.
* - Added killfile c:$.ql to @1 and @4.
* - Changed FC0 to fc0 in macros and batch files for better
* - visibility.
* 1.0e - Added @5 for prompted replacement from command line
* - Added @6 for prompted replacement while editing
* - Added F4/F6 repeatfind/nextfile
* - Modified @4 for single search/replacement text input.
* 1.0f - Modified SR.BAT and SRC.BAT
* 1.0g - Modified SR.BAT, SRC.BAT and START-SR.BAT.
* - Removed INPUT.COM and INPUT.DOC pending author
* permission to include.
* 1.0h - Removed SRC.BAT, Modified all macros and batch files for
* NON-case sensitive search
* - Added @7 and SRL.BAT to only load files with search text,
* no replacement
* - Modified SR.BAT to load SRCHxx.MAC on start up.
* 1.0i - Modified @3 to re-load files after replacement.
* - Modified all macros and batch files for NON-case
* sensitive search, some had not been changed in v1.0h.
* - Corrected some macro byte sizes
* 1.0j - Modified comments in SR.BAT, SRL.BAT
* - Modified @7 to about half the size and twice the speed.
* - Included a PCED synonym to search/load files with @7.
* 1.1 - Corrected @7 macro size
* - Removed savefile from old @0
* - Modified @0 to load FGREP found text, after replacement.
* - Added [copy c:$.ql c:!] to SR.BAT
* - Changed FGREP "-f0" to "-f" in SR.BAT, loads found text
* - Removed @5, same thing can be done with @1/2 and
* manual search/replace.
* - Modified srch.ql load filelist for quicker file loading.
* 1.2 - Changed "c:$.ql" to "c:!" in macros @1/4/6, shortened
* each macro 12 bytes.
* 1.3 - Modified @3 to be smaller and faster.
* 1.4 - Changed "*F" to #42 "Fi" in @0 and @7 to be able to load
* this file and SRL.QM with SR and SRL.
* - Modified SRL.BAT to accept SRL [search text] from command
* as long as [search text] is a SINGLE word.
* - Added altwordset to @0 and @7 to correctly load file names
* containing the following characters: !#$%&'(),-./@{}~
* - Changed .lst and .ql files.
* 1.5 - Removed E:\up from SR.BAT & SRL.BAT
* 1.6 - Added @8 and @9, modified SR.BAT and SRL.BAT.
* - @3 was deleting first character in loaded files,
* corrected.
* 1.7 - Added @h to help locate items or macros from Index.
* - Added @5.
* - Removed @3, same thing is done better by @8.
* - Removed @4 and @6, same thing is done better with @5.
* - Modified @0 to use the "Once-Around the ring"
* technique developed by Kyle Watkins of SemWare.
* - Modified SR.BAT and SRL.BAT.
* 1.8 - Replaced RepeatFind w/ Find "G" in @9.
* - Modified SR.BAT and SRL.BAT.
* 1.9 - Changed Find initialization in @5 and @0.
* - Modified START-SR.BAT for no search/replace text.
* - Modified @5, @8, @9 and @0 to be shorter and faster.
* - Moved SET >c:$ from @0 macro to SR.BAT batch file.
* 2.0 - Added @a, @f, ^a, ^f variations of wordleft & wordright.
* - Changed quick start file from START-SR to START.
* 2.1 - Added new key definitions for CursorLeft and CursorRight
* to wrap cursor to previous/next line like Wordstar does.
* - Changed SEARCH file names to SRCH.
* 2.1a - Corrected Index Use instructions.
* Tom Hogshead Fri 01-11-1991